Page({
  data: {
    url: "",
    ops: ''
  },
  onLoad: function(e) {
    console.log(e)
    console.log(decodeURIComponent(e.url))
    this.setData({
      url: decodeURIComponent(e.url),
      ops: e
    })
  },
  onUnload: function () {
    getCurrentPages()[0].route == 'pages/web/web' ? wx.reLaunch({url:'/pages/index/index'}) : wx.navigateBack({delta:1});
  },
  onShareAppMessage: function(e) {
    let o = this.data.ops;
    let result = {
      path: '/pages/web/web?&url='+o.url,
      title: decodeURIComponent(o.title),
      imageUrl: o.img
    }
    o.title == 'undefined' ? delete result.title : result.path += '&title=' + o.title;
    o.img == 'undefined' ? delete result.imageUrl : result.path += '&img=' + o.img;
    console.log(result);
    return  result;

  },
  handleGetMessage: function(e) {
    console.log(e)
  }
})